extern crate redis;

use redis::{ConnectionInfo, ConnectionAddr};

#[test]
fn redis_test() {
    let redis_con = ConnectionInfo {
        addr: Box::new(ConnectionAddr::Tcp("60.166.12.158".to_string(), 8379)),
        db: 0,
        passwd: Option::from("xylxredis123!@#mima".to_string()),
    };
    let client = redis::Client::open(redis_con).unwrap();
    let mut con = client.get_connection().unwrap();
    let _: () = redis::cmd("SET").arg("my_key").arg("VAAS").query(&mut con).unwrap();
    let name: String = redis::cmd("GET").arg("my_key").query(&mut con).unwrap();

//    let name: String = con.get("my_key");my_key
//    let _: () = con.set("my_key", 42);
//    let _: () = con.set("my_key", 42)?;
//    let name: i16 = con.get("my_key")?;
    println!("{}", name);
}